package com.pt25.service.sys.interfaces.vo.config;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pt25.base.util.JsonUtil;
import com.pt25.base.util.PageUtil;
import com.pt25.base.validator.CreateGroup;
import com.pt25.service.sys.domain.config.ddo.ConfigType;
import jakarta.validation.constraints.NotBlank;
import lombok.*;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(
        callSuper = true
)
public class ConfigTypeVo extends PageUtil.PageBase {
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    /**
     * 配置code
     */
    @NotBlank(message = "typeName 不能为空")
    private String typeName;
    /**
     * 配置标题
     */
    @NotBlank(groups = {CreateGroup.class}, message = "typeTitle 不能为空")
    private String typeTitle;
    /**
     * 配置描述
     */
    @NotBlank(groups = {CreateGroup.class}, message = "typeDescription 不能为空")
    private String typeDescription;


    public ConfigType toConfigType() {
        return JsonUtil.toBean(JsonUtil.toJson(this), ConfigType.class);
    }
}
